package com.xiaotu.constant;

/**
 * @author zhangxiao
 * @create 2021-10-19 10:31
 */
public enum CampType {

    Red(0, "红方"),
    Black(1, "黑方");

    private int val;
    private String name;

    CampType(int val, String name) {
        this.val = val;
        this.name = name;
    }

    public int getVal() {
        return this.val;
    }

    public static CampType getCampTypeByVal(int val) {
        for (CampType value : CampType.values()) {
            if (value.getVal() == val) {
                return value;
            }
        }
        return null;
    }
}
